package liuch.yield;

public class YieldTestThread extends Thread {
    @Override
    public void run() {
        long begin = System.currentTimeMillis();
        int count = 0;
        while (true) {
            Thread.yield();
            count++;
            if (count == 5000000) {
                break;
            }
        }
        System.out.println(System.currentTimeMillis() - begin);
    }
}
